package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.Chat;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChatMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Chat record);

    Chat selectByPrimaryKey(Long id);

    List<Chat> selectAll();

    int updateByPrimaryKey(Chat record);
    /*
    * 查聊天历史记录
    * */
    List<Chat> listForChatHistory(@Param("sendId") Long sendId, @Param("receiveId") Long receiveId);
    /*
    * 查未读状态
    * */
    List<Chat> listState(@Param("receiveId") Long receiveId);
    /*
    * 清除未读状态
    * */
    void updateState(@Param("receiveId") Long receiveId);
    /*
    * 查询未读数量数量
    * */
    Integer listStateNum(@Param("receiveId") Long receiveId);
}